home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample SMSAM / SampleSMSAM Source / TupleDatabase / RamTupleDatabase.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-28  |  2.0 KB  |  67 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        RamTupleDatabase.h
  3.  
  4.     Copyright:    © 1991-1994 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Part of the AOCE Sample SMSAM Package.  Consult the license
  8.     which came with this software for your specific legal rights.
  9.  
  10. */
  11.  
  12.  
  13.  
  14. #ifndef __RAMTUPLEDATABASE__
  15. #define __RAMTUPLEDATABASE__
  16.  
  17. #ifndef __BLJSTANDARDINCLUDES__
  18. #include "BLJStandardIncludes.h"
  19. #endif
  20.  
  21. #ifndef __TUPLEDATABASE__
  22. #include "TupleDatabase.h"
  23. #endif
  24.  
  25. /***********************************|****************************************/
  26.  
  27. class CTupleEntry;
  28.  
  29. class TRamTupleDatabase : public ATupleDatabase
  30. {
  31. public:
  32.                                     TRamTupleDatabase ();
  33.     virtual                         ~TRamTupleDatabase ();
  34.  
  35.     virtual Boolean                 SetTuple ( const ATupleKey&, const ADataItem& );
  36.     virtual Boolean                 SetTuple ( unsigned long index, const ADataItem& );
  37.     
  38.     virtual Boolean                 GetTuple ( unsigned long index, ATupleKey&, ADataItem& );
  39.     virtual Boolean                 GetTupleData ( const ATupleKey&, ADataItem& );
  40.     virtual Boolean                 GetTupleData ( unsigned long index, ADataItem& );
  41.     virtual Boolean                 GetTupleKey ( unsigned long index, ATupleKey& );
  42.     virtual Boolean                 GetTupleDataSize ( const ATupleKey&, unsigned long& );
  43.     
  44.     virtual Boolean                 DeleteTuple ( const ATupleKey& );
  45.     
  46.     virtual Boolean                 FindIndexOfTuple ( const ATupleKey&, unsigned long& index ) const;
  47.     virtual Boolean                 DoesTupleExist ( const ATupleKey& ) const;
  48.     virtual unsigned long             CountTuples () const;
  49.  
  50.     virtual    void                    PrintSubtree ( ostream&, const CTupleEntry* root ) const;
  51.     virtual    ostream&                operator >> ( ostream& ) const;
  52.     
  53. private:                            TRamTupleDatabase ( const TRamTupleDatabase& );
  54.             TRamTupleDatabase&        operator = ( const TRamTupleDatabase& );
  55.             
  56.             CTupleEntry*            FindTuple ( const ATupleKey& attach ) const;
  57.             CTupleEntry*            FindTuple ( unsigned long, CTupleEntry* ) const;
  58.             CTupleEntry*&            FindTuple ( const ATupleKey& attach, CTupleEntry*& parent ) const;
  59.             
  60.             CTupleEntry*            fRoot;
  61.             unsigned long            fTupleCount;
  62. };
  63.  
  64. /***********************************|****************************************/
  65.  
  66. #endif    // __RAMTUPLEDATABASE__
  67.